﻿using System.Collections.ObjectModel;

namespace AOUtils.Libraries
{
    public class AttackValueCollection : KeyedCollection<AttackValueTypes, AttackValue>
    {
        protected override AttackValueTypes GetKeyForItem(AttackValue item)
        {
            return item.Name;
        }

        protected override void InsertItem(int index, AttackValue item)
        {
            if (Dictionary != null && Dictionary.Keys.Contains(item.Name))
                return;
            base.InsertItem(index, item);
        }

        protected override void SetItem(int index, AttackValue item)
        {
            base.SetItem(index, item);
        }
    }
}
